package by.dkusch.aircompany.services.impl;

import java.util.Set;

import org.springframework.stereotype.Service;

import by.dkusch.aircompany.dao.PersonDao;
import by.dkusch.aircompany.model.tables.Crew;
import by.dkusch.aircompany.model.tables.Person;
import by.dkusch.aircompany.services.PersonService;

@Service
public class PersonServiceImpl extends AbstractServiceImpl<Long, Person> implements PersonService {

	@Override
	public void saveOrUpdate(Person ent) {
		ent.setuFIO();
		super.saveOrUpdate(ent);
	}

	@Override
	public Person getByIdWithLazyDetails(Long id) {
		return ((PersonDao) dao).getByIdWithLazyDetails(id);
	}

	@Override
	public Set<Crew> getCrewSet(Long id) {
		return ((PersonDao) dao).getCrewSet(id);
	}

}
